package 类的定义;

/**
 * 学生类
 */
public class Student {
    public String name;//属性

    /**
     * 方法
     */
    public void study(){
        System.out.println("我是学生"+name+",正在学习");
    }
    public static void hi(){
        System.out.println("hi,everybody!");
    }
    public static void main(String[] args){
        Student stu=new Student();
        stu.name="孙悟空";
        stu.study();
    }
}

class Hello{
    public static void main(String[] args){
        Student s1=new Student(); //s1为对象
        Student s2=new Student(); //s2为对象
        Student.hi();
        s1.name="张三";
        s1.study();
        s2.name="猪八戒";
        s2.study();
    }

    public static class Test {
        public static void main(String[] args){
            Student s1=new Student();
            s1.name="xxx";
            s1.study();
        }
    }
}
